package com.example.tests;

public class ContactData implements Comparable<ContactData> {
	
	private String contactname;
	private String lastname;
	private String address;
	private String home;
	private String mobile;
	private String work;
	private String email;
	private String email2;
	private String bday;
	private String bmonth;
	private String byear;
	private String group;
	private String address2;
	private String home2;

	public ContactData() {
	
	}
	public ContactData(String contactname, String lastname, String address,
			String home, String mobile, String work, String email,
			String email2, String bday, String bmonth, String byear, String group,
			String address2, String home2) {
		this.contactname = contactname;
		this.lastname = lastname;
		this.address = address;
		this.home = home;
		this.mobile = mobile;
		this.work = work;
		this.email = email;
		this.email2 = email2;
		this.bday = bday;
		this.bmonth = bmonth;
		this.byear = byear;
		this.group = group;
		this.address2 = address2;
		this.home2 = home2;
	}
	

	
	@Override
	public String toString() {
		return "ContactData [contactname=" + contactname + ", lastname="
				+ lastname + ", address=" + address + ", home=" + home
				+ ", mobile=" + mobile + ", work=" + work + ", email=" + email
				+ ", email2=" + email2 + ", bday=" + bday + ", bmonth="
				+ bmonth + ", byear=" + byear + ", group=" + group
				+ ", address2=" + address2 + ", home2=" + home2 + "]";
	}
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		/*result = prime * result
				+ ((contactname == null) ? 0 : contactname.hashCode()); */
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ContactData other = (ContactData) obj;
		if (contactname == null) {
			if (other.contactname != null)
				return false;
		} else if (!contactname.equals(other.contactname))
			return false;
		return true;
	}
	
	@Override
	public int compareTo(ContactData other) {
		return this.contactname.compareTo(other.contactname);
	}
	
	public ContactData withContactname(String contactname) {
		this.contactname = contactname;
		return this;
	}
	public ContactData withAddress(String address) {
		this.address = address;
		return this;
	}
	public ContactData withHome(String home) {
		this.home = home;
		return this;
	}
	
	public ContactData withMobile(String mobile) {
		this.mobile = mobile;
		return this;
	}
	public ContactData withWork(String work) {
		this.work = work;
		return this;
	}
	public ContactData withEmail(String email) {
		this.email = email;
		return this;
	}
	public ContactData withEmail2(String email2) {
		this.email2 = email2;
		return this;
	}
	public ContactData withBday(String bday) {
		this.bday = bday;
		return this;
	}
	public ContactData withBmonth(String bmonth) {
		this.bmonth = bmonth;
		return this;
	}
	public ContactData withByear(String byear) {
		this.byear = byear;
		return this;
	}
	public ContactData withGroup(String group) {
		this.group = "[none]";
		return this;
	}
	public ContactData withAddress2(String address2) {
		this.address2 = address2;
		return this;
	}
	public ContactData withHome2(String home2) {
		this.home2 = home2;
		return this;
	}
	public ContactData withLastname(String lastname2) {
		lastname = lastname2;
		return this;
	}
	public String getContactname() {
		return contactname;
	}
	public String getLastname() {
		return lastname;
	}
	public String getAddress() {
		return address;
	}
	public String getHome() {
		return home;
	}
	public String getMobile() {
		return mobile;
	}
	public String getWork() {
		return work;
	}
	public String getEmail() {
		return email;
	}
	public String getEmail2() {
		return email2;
	}
	public String getBday() {
		return bday;
	}
	public String getBmonth() {
		return bmonth;
	}
	public String getByear() {
		return byear;
	}
	public String getGroup() {
		return group;
	}
	public String getAddress2() {
		return address2;
	}
	public String getHome2() {
		return home2;
	}
	
	
	
	
}